<?php

class Object {

    // Used to report user friendly errors.
    function error($method, $messages) {
        if (!class_exists('ErrorHandler')) {
            uses('error');
            if (file_exists(APP . 'error.php')) {
                include_once (APP . 'error.php');
            }
        }

        if (class_exists('AppError')) {
            $error = new AppError($method, $messages);
        } else {
            $error = new ErrorHandler($method, $messages);
        }
        return $error;
    }
}
?>
